package com.zpengblog.top.messagecenter.controller;

import ch.qos.logback.classic.Logger;
import com.zpengblog.top.messagecenter.service.WebsocketServer;
import jdk.nashorn.internal.objects.annotations.Getter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author linzp
 * @version 1.0.0
 * CreateDate 2020/8/7 1:00
 */
@RestController
@Slf4j
public class PushMessageController {


    /**
     * 测试业务层调用推送消息.
     */
    @PostMapping("/pushMessage")
    public String pushMessage(){
        log.info("进入用户推送消息方法了！！");
        List<String> orgList = new ArrayList<>();
        orgList.add("111");
        orgList.add("222");
        WebsocketServer.pushMessageToOrg(orgList);
        return "推送成功！！";
    }
}
